.mr-state-widget
  = render 'projects/merge_requests/widget/heading'
  .mr-widget-body
    %h4
      已合并
      - if @merge_request.merge_event
        提交者：#{link_to_member(@project, @merge_request.merge_event.author, avatar: true)}
        #{time_ago_with_tooltip(@merge_request.merge_event.created_at)}
    - if !@merge_request.source_branch_exists? || (params[:delete_source] == 'true')
      %p
        此变更已合并到
        #{link_to @merge_request.target_branch, namespace_project_commits_path(@project.namespace, @project, @merge_request.target_branch), class: "label-branch"}.
        来源分支已被删除。
      = render 'projects/merge_requests/widget/merged_buttons'
    - elsif @merge_request.can_remove_source_branch?(current_user)
      .remove_source_branch_widget
        %p
          此变更已合并到
          #{link_to @merge_request.target_branch, namespace_project_commits_path(@project.namespace, @project, @merge_request.target_branch), class: "label-branch"}.
          你现在可以删除来源分支。
        = render 'projects/merge_requests/widget/merged_buttons', source_branch_exists: true
      .remove_source_branch_widget.failed.hide
        %p
          删除来源分支 '#{@merge_request.source_branch}' 失败。

      .remove_source_branch_in_progress.hide
        %p
          = icon('spinner spin')
          正在删除来源分支 '#{@merge_request.source_branch}'。请稍候，页面将会被自动重载。
    - else
      %p
        此变更已合并到
        #{link_to @merge_request.target_branch, namespace_project_commits_path(@project.namespace, @project, @merge_request.target_branch), class: "label-branch"}.
      = render 'projects/merge_requests/widget/merged_buttons'
